package com;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * @author ：Dsi
 * @date ：2021/11/18 15:00
 * Describe ：
 */
public class AnalyzeSourceCode {
    public static void main(String[] args) throws Throwable {
        analyzeSourceCode();
    }

    public static List<String> analyzeSourceCode() throws Throwable {
        GetSourceCode G=new GetSourceCode();
        String[] a=G.getSourceCode();
        String a1= Arrays.toString(a);
        String[] out = a1.split("src=\"");
        List<String> c=new ArrayList<>();
//        String regex="src=\"/uploads/allimg";
        String regex=".jpg";
        for (String s: out
        ) {
            if(s.contains(regex)){
                c.add(s);
            }
        }
        System.out.println(c);
        /*
        List<String> c1=new ArrayList<>();
        for (String s1:c
        ) {
            int b=s1.indexOf("/");
            int b2=s1.indexOf(".jpg");
            c1.add(s1.substring(b,b2+4));
        }

         */
        return c;
    }
}
